<?php
/*
 * Autoloads classes - project specific and libraries (based on naming convetion).
 * uses CLASS_PATH, INCLUDE_PATH
 */

// autoloading project classes
spl_autoload_register('autoload_src_class', true);

function autoload_src_class($class) {
	$filepath = CLASS_PATH . str_replace('\\', '/', $class) . '.php';
	if (file_exists($filepath))
		include_once $filepath;
}

// autoloading lib classess
spl_autoload_register('autoload_lib_class', true);

function autoload_lib_class($class) {
	$filepath = INCLUDE_PATH . str_replace('\\', '/', $class) . '.php';
	if (file_exists($filepath))
		include_once $filepath;
}